<#include "/includes/vars.inc">  
<#include "/includes/embed_macro.inc"> 
<@pp.dropOutputFile />
<#list entities.entity as entity>
    <@pp.changeOutputFile name="${webDir}/jeecode/"+entity.@name?uncap_first+"/include/"+entity.@name?cap_first+"DataEdit.xhtml" />
    <#assign entityName = entity.@name>
    <#assign managedBean = entity.@name?uncap_first+"Controller">
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
     
    <ui:composition>
    <#list entity.column as column>
        <#if (column.@primary[0]="false") && (column.@mode[0]="MANUAL")>
            <#if column.@type="Date">
        <h:outputLabel for="${column.@name}" value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        <p:calendar id="${column.@name}" pattern="${config.date.@pattern}"  value="${r"#{"}${managedBean}.current.${column.@name?uncap_first}${r"}"}" title="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}" <#if column.@required[0]="true">required="true" requiredMessage="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}Required${r"}"}"</#if>/>
            <#elseif column.@type?cap_first = "Boolean">
        <h:outputLabel for="${column.@name}" value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        <h:selectBooleanCheckbox id="${column.@name}" value="${r"#{"}${managedBean}.current.${column.@name}${r"}"}" />
            <#elseif column.@type="String" && column.@size[0]??  && (column.@size?number > 256) >
        <h:outputLabel for="${column.@name}" value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        <h:inputTextarea rows="5" cols="50" id="${column.@name}" value="${r"#{"}${managedBean}.current.${column.@name?uncap_first}${r"}"}" title="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}" <#if column.@required[0]="true">required="true" requiredMessage="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}Required${r"}"}"</#if>/>
            <#elseif column.@type="String" >
        <h:outputLabel for="${column.@name}" value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        <h:inputText id="${column.@name}" size="50" value="${r"#{"}${managedBean}.current.${column.@name?uncap_first}${r"}"}" title="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}" <#if column.@required[0]="true">required="true" requiredMessage="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}Required${r"}"}"</#if>/>
           <#elseif enums.enum.@name?seq_contains(column.@type)>
        <h:outputLabel for="${column.@name}" value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        <h:selectOneMenu id="${column.@name}" value="${r"#{"}${managedBean}.current.${column.@name?uncap_first}${r"}"}" title="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}" <#if column.@required[0]="true">required="true" requiredMessage="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}Required${r"}"}"</#if>>
            <f:selectItems value="${r"#{"}utilController.${column.@type?uncap_first}Items${r"}"}"/>
        </h:selectOneMenu>
        	<#elseif embeddables.embeddable.@name?seq_contains(column.@type)>
        <@resolveEmbedEdit entityName="${entityName}" embedName="${column.@type}" columnName="${column.@name}" />
            <#else>
        <h:outputLabel for="${column.@name}" value="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}:" />
        		<#if column.@name="password">
        <h:inputSecret id="${column.@name}" value="${r"#{"}${managedBean}.current.${column.@name?uncap_first}${r"}"}" title="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}" <#if column.@required[0]="true">required="true" requiredMessage="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}Required${r"}"}"</#if>/>
            	<#else>
        <h:inputText id="${column.@name}" value="${r"#{"}${managedBean}.current.${column.@name?uncap_first}${r"}"}" title="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}${r"}"}" <#if column.@required[0]="true">required="true" requiredMessage="${r"#{"}msg.${entityName?uncap_first}${column.@name?cap_first}Required${r"}"}"</#if>/>   	
            	</#if>
            </#if>
        </#if>

    </#list>
    <#list entity["many-to-one"] as rel>
    	<#--<#if entity.@parent[0]?? && rel.@entity != entity.@parent >-->
    	<#if rel.@mode[0] = "MANUAL" >
    		<#assign managedBeanRel = rel.@entity?uncap_first+"Controller">
    	<h:outputLabel for="${rel.@name}" value="${r"#{"}msg.${entityName?uncap_first}${rel.@name?cap_first}${r"}"}:" />
        <h:selectOneMenu id="${rel.@name}" converter="${rel.@entity?uncap_first}Converter" value="${r"#{"}${managedBean}.current.${rel.@name?uncap_first}${r"}"}" title="${r"#{"}msg.${entityName?uncap_first}${rel.@name?cap_first}${r"}"}" <#if rel.@required[0]="true">required="true" requiredMessage="${r"#{"}msg.${entityName?uncap_first}${rel.@name?cap_first}Required${r"}"}"</#if>>
            <f:selectItems value="${r"#{"}${managedBeanRel}.${rel.@entity?uncap_first}Items${r"}"}"/>
        </h:selectOneMenu>
        </#if>
        
    </#list>
    <#list entity["one-to-one"] as rel>
    	<#if rel.@mode[0] = "MANUAL" >
    		<#assign managedBeanRel = rel.@entity?uncap_first+"Controller">
    	<h:outputLabel for="${rel.@name}" value="${r"#{"}msg.${entityName?uncap_first}${rel.@name?cap_first}${r"}"}:" />
        <h:selectOneMenu id="${rel.@name}" converter="${rel.@entity?uncap_first}Converter" value="${r"#{"}${managedBean}.current.${rel.@name?uncap_first}${r"}"}" title="${r"#{"}msg.${entityName?uncap_first}${rel.@name?cap_first}${r"}"}" <#if rel.@required[0]="true">required="true" requiredMessage="${r"#{"}msg.${entityName?uncap_first}${rel.@name?cap_first}Required${r"}"}"</#if>>
            <f:selectItems value="${r"#{"}${managedBeanRel}.${rel.@entity?uncap_first}Items${r"}"}"/>
        </h:selectOneMenu>
        </#if>
        
    </#list>
    </ui:composition>
</html>

</#list>